Skip to content

Name the arguments of describe_consumer_groups() and describe_topics() in order - #2437

Closed
Pierre-Yves Le Borgne (pylaterreur) wants to merge 1 commit into
confluentinc:masterfrom
pylaterreur:fix/admin-describe-keyword-names
Closed

Pierre-Yves Le Borgne (pylaterreur) wants to merge 1 commit into
confluentinc:masterfrom
pylaterreur:fix/admin-describe-keyword-names

Conversation

@pylaterreur

Copy link
Copy Markdown
Contributor

What

The C methods describe_consumer_groups() and describe_topics() of _AdminClientImpl take the group ids or topic names first and the future second, but their keyword list names them in the opposite order. Called with keywords, as in describe_consumer_groups(group_ids=..., future=...), the group ids go to the future and the call fails with "Expected non-empty list of group_ids"; describe_topics(topic_names=..., future=...) fails with "Expected a list of topics". AdminClient passes them by position, so only direct callers are affected.

The keyword lists now name the arguments in the order they are parsed. Both doc strings and the describe_topics() stub in cimpl.pyi had the same reversed order and are fixed too, which makes the # type: ignore[arg-type] in AdminClient.describe_topics() unnecessary.

Checklist

  • Contains customer facing changes? Including API/behavior changes
    • Only for code calling these _AdminClientImpl methods directly with keywords, which the doc strings say not to use. No CHANGELOG entry.
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • test_describe_consumer_groups_and_topics_keyword_arguments in tests/test_Admin.py calls both with keywords.

References

Test & Review

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

…) in order

The C methods describe_consumer_groups() and describe_topics() of
_AdminClientImpl take the group ids or topic names first and the future
second, but their keyword list named them in the opposite order: called
with keywords, as in describe_consumer_groups(group_ids=..., future=...),
the group ids went to the future and the call failed with "Expected
non-empty list of group_ids". AdminClient passes them by position, so
only direct callers were affected.

Name them in the order they are parsed, fix the order in both doc
strings and in the describe_topics() stub, and drop the type: ignore
that the stub made necessary in AdminClient.describe_topics().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ pylaterreur
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@Ankith-Confluent

Copy link
Copy Markdown
Member

Thanks for finding this. I'm closing it because it doesn't affect users. The reversed keyword names are only in _AdminClientImpl, which isn't meant to be called directly. AdminClient.describe_consumer_groups() and describe_topics() pass these arguments by position, so calls through the public API work, keywords included. I checked this on 2.16.1. If we later need the stub and the docstrings to match the C signature, we can include this change in a broader cleanup of cimpl.pyi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants